package com.salelogistics.basic.service.impl;

import java.util.List;
import com.salelogistics.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.salelogistics.basic.mapper.BasContractMapper;
import com.salelogistics.basic.domain.BasContract;
import com.salelogistics.basic.service.IBasContractService;

/**
 * 合同Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-07-10
 */
@Service
public class BasContractServiceImpl implements IBasContractService 
{
    @Autowired
    private BasContractMapper basContractMapper;

    /**
     * 查询合同
     * 
     * @param contractId 合同主键
     * @return 合同
     */
    @Override
    public BasContract selectBasContractByContractId(Long contractId)
    {
        return basContractMapper.selectBasContractByContractId(contractId);
    }

    /**
     * 查询合同列表
     * 
     * @param basContract 合同
     * @return 合同
     */
    @Override
    public List<BasContract> selectBasContractList(BasContract basContract)
    {
        return basContractMapper.selectBasContractList(basContract);
    }

    /**
     * 新增合同
     * 
     * @param basContract 合同
     * @return 结果
     */
    @Override
    public int insertBasContract(BasContract basContract)
    {
        basContract.setCreateTime(DateUtils.getNowDate());
        return basContractMapper.insertBasContract(basContract);
    }

    /**
     * 修改合同
     * 
     * @param basContract 合同
     * @return 结果
     */
    @Override
    public int updateBasContract(BasContract basContract)
    {
        return basContractMapper.updateBasContract(basContract);
    }

    /**
     * 批量删除合同
     * 
     * @param contractIds 需要删除的合同主键
     * @return 结果
     */
    @Override
    public int deleteBasContractByContractIds(Long[] contractIds)
    {
        return basContractMapper.deleteBasContractByContractIds(contractIds);
    }

    /**
     * 删除合同信息
     * 
     * @param contractId 合同主键
     * @return 结果
     */
    @Override
    public int deleteBasContractByContractId(Long contractId)
    {
        return basContractMapper.deleteBasContractByContractId(contractId);
    }
}
